//订单详情页面的渲染

getOrderDetails();
function getOrderDetails() {
    var orderId = $(".orderId").val();
    $.ajax({
        type: "GET",
        url: "/fresh/orderDetails/getAll/" + orderId,
        dataType: "json",
        success:function (result) {
           if (result.status ==1){
               console.log("查询订单详情成功");
               $(".mc-ul").html("");
               var str ="";
               $.each(result.data,function (index,orderDetails) {
                    var img = orderDetails.productImages.productImagesImage;
                    var productName = orderDetails.product.productName;
                    var productPrice = orderDetails.product.productPrice;
                    var productCount = orderDetails.productCount;


                    var ele=" <li class=\"mc-ul-li\">\n" +
                        "                    <div class=\"product-mess\">\n" +
                        "                        <img src='/fresh/images/"+img+"' style=\"height: 60px;height: 60px\" class=\"product-img\">\n" +
                        "                        <span class=\"f1\">商品名称:</span>\n" +
                        "                        <span class=\"product-name\">"+productName+"</span>\n" +
                        "\n" +
                        "                        <span class=\"f2\">￥</span>\n" +
                        "                        <span class=\"product-price\">"+productPrice+"</span>\n" +
                        "                        <span class=\"product-count-x\">x</span>\n" +
                        "                        <span class=\"product-count\">"+productCount+"</span>\n" +
                        "                    </div>\n" +
                        "\n" +
                        "                </li>"

                   str +=ele;
               })

               $(".mc-ul").html(str);

           }else {
               console.log("查询订单详情失败");
           }
        }
    })
}